package com.itwxz.system.controller.pc;

import com.itwxz.common.core.domain.R;
import com.itwxz.system.domain.dto.EchartsOrderDto;
import com.itwxz.system.service.WxzEchartsService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "首页Controller")
@RestController
@RequestMapping("/wxz/echarts")
@RequiredArgsConstructor
public class EchartsController {
    private final WxzEchartsService echartsService;

    @GetMapping("/order")
    @Cacheable(value = "statistics", key = "'list'")
    public R<EchartsOrderDto> statistics() {
        return echartsService.orderStatistics();
    }
}
